{include file="public/header" /}


<div class="page">
    <div class="fixed-bar">
        <div class="item-title">
            <div class="subject">
                <h3>{$Think.lang.course_list}</h3>
            </div>
            {include file="public/admin_items" /}
        </div>
    </div>


    <form method="get" name="formSearch" id="formSearch">
        <div class="ds-search-form">
            <dl>
                <dt>子教程标题：</dt>
                <dd><input type="text" name="title" id="store_name" class="txt" value="{$Request.get.title|default=''}"  ></dd>
                <input type="hidden" name="course_id" value="{$course_id}">
            </dl>
            <dl>
                <dt><label>子教程状态:</label></dt>
                <dd>
                    <select name="status">
                        <option value="">{$Think.lang.ds_please_choose}...</option>
                        <option value="1" {if isset($_GET['status']) &&  $_GET['status'] == 1 }selected{/if} >启用</option>
                        <option value="2" {if isset($_GET['status']) &&  $_GET['status'] == 2 }selected{/if} >停用</option>
                    </select>
                </dd>
            </dl>

            <div class="btn_group">
                <dd><input type="submit" class="btn" value="{$Think.lang.ds_search}"></dd>
                <a href="{:url('Course/course_son_list',['course_id'=>$course_id])}" class="btn btn-default" title="取消">取消</a>
            </div>
        </div>
    </form>

    <table class="ds-default-table">
        <thead>
        <tr class="thead">
            <th>序号</th>
            <th>子教程标题</th>
            <th>子教程类型</th>
            <th>排序</th>
            <th>{$Think.lang.course_status}</th>
            <th>{$Think.lang.course_set}</th>
        </tr>
        </thead>
        <tbody>
        {notempty name="course_list"}
        <?php $index=1; foreach($course_list as $k=>$v ){ ?>
        <tr class="hover edit" id="ds_row_{$v.id}">
            <td style="width: 150px;">
                <span>{$index}</span>
            </td>
            <td style="width: 500px;" >
                <span>{$v.title}</span>
            </td>
            <td style="width: 500px;" >
                <span>
                    {if condition="($v.qu==1)"}视频
                    {elseif condition="($v.qu==2)"}文章
                    {/if}
                </span>
            </td>
            <td style="width: 150px;">{$v.x_id}</td>
            <td>{$v.status}</td>
            <td>
                {if $v.qu == 1}
                <a href="javascript:void(0);"   onclick="videos_detail({$v.id})"  class="dsui-btn-view" >{$Think.lang.course_video}</a>
                {/if}
                <a href="{:url('Course/course_son_edit',['course_id'=>$v.id])}" class="dsui-btn-edit" >{$Think.lang.ds_edit}</a>
                <a href="javascript:dsLayerConfirm('{:url('Course/course_son_del',['course_id'=>$v.id])}','{$Think.lang.ds_ensure_del}',{$v.id})" class="dsui-btn-del" >{$Think.lang.ds_del}</a>
            </td>
        </tr>
        <?php $index++; }?>
        {else /}
        <tr class="no_data">
            <td colspan="10">{$Think.lang.ds_no_record}</td>
        </tr>
        {/notempty}
        </tbody>
    </table>
</div>

<script type="text/javascript" src="{$Think.ADMIN_SITE_ROOT}/js/jquery.edit.js" charset="utf-8"></script>
<script src="{$Think.ADMIN_SITE_ROOT}/js/jquery.goods_class.js"></script>
<script type="text/javascript">
    // 查看视频
    function videos_detail(ids_str) {
        _uri = ADMINSITEURL+"/Course/video_list?id=" + ids_str;
        dsLayerOpen(_uri,'查看视频','600px','400px');
    }

    function submit_delete(ids_str) {
        _uri = ADMINSITEURL + "/Goodsclass/goods_class_del.html?gc_id=" + ids_str;
        dsLayerConfirm(_uri, '{$Think.lang.ds_ensure_del}');
    }
</script>